import request from "@/utils/request";

// 查询加班列表
export function listOvertimeapply(query) {
  return request({
    url: "/system/overtimeapply/list",
    method: "get",
    params: query,
  });
}

// 查询加班详细
export function getOvertimeapply(id) {
  return request({
    url: "/system/overtimeapply/" + id,
    method: "get",
  });
}

// 新增加班
export function addOvertimeapply(data) {
  return request({
    url: "/system/overtimeapply",
    method: "post",
    data: data,
  });
}

// 修改加班
export function updateOvertimeapply(data) {
  return request({
    url: "/system/overtimeapply",
    method: "put",
    data: data,
  });
}

// 删除加班
export function delOvertimeapply(id) {
  return request({
    url: "/system/overtimeapply/" + id,
    method: "delete",
  });
}

// 导出加班
export function exportOvertimeapply(query) {
  return request({
    url: "/system/overtimeapply/export",
    method: "get",
    params: query,
  });
}

// 获取部门经理
export function getDeptManagers(userId) {
  return request({
    url: "/system/overtimeapply/approvers/" + userId,
    method: "get",
  });
}

// 获取本月加班统计
export function getMonthOvertimeStats(params) {
  return request({
    url: "/system/overtimeapply/monthStats",
    method: "get",
    params: params,
  });
}
